package com.yuexunit.operationman.nbsy.module.plant.model.impl;

import com.yuexunit.operationman.nbsy.Api.Api;
import com.yuexunit.operationman.nbsy.module.plant.bean.ImplantMaterialItemListEntity;
import com.yuexunit.operationman.nbsy.module.plant.bean.MaterialDeviceBean;
import com.yuexunit.operationman.nbsy.module.plant.model.IMaterialDeviceModel;
import com.yuexunit.operationman.nbsy.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2017/7/20 0020.
 */

public class MaterialDeviceModel implements IMaterialDeviceModel {
    Api api;

    public  Api getApiInstance() {
        if(api!=null) {
            return api;
        }else{
            api= ApiUtil.getInstance().createRetrofitApi(Api.class);
            return api;
        }
    }

    @Override
    public Observable<MaterialDeviceBean<ImplantMaterialItemListEntity>> getMaterialDevice(Map<String, String> praise) {
        api=getApiInstance();
        return api.getMaterialDevice(praise);
    }
}
